import request from '@/utils/request'
export function fetchList(params) {
  return request({
    url:'/product/list',
    method:'get',
    params:params
  })
}

export function fetchSimpleList(params) {
  return request({
    url:'/product/simpleList',
    method:'get',
    params:params
  })
}

export function updateDeleteStatus(params) {
  return request({
    url:'/product/update/deleteStatus',
    method:'post',
    params:params
  })
}

export function updateNewStatus(params) {
  return request({
    url:'/product/update/newStatus',
    method:'post',
    params:params
  })
}

export function updateRecommendStatus(params) {
  return request({
    url:'/product/update/recommendStatus',
    method:'post',
    params:params
  })
}

export function updatePublishStatus(params) {
  return request({
    url:'/product/update/publishStatus',
    method:'post',
    params:params
  })
}

export function createProduct(data) {
  return request({
    url:'/product/create',
    method:'post',
    data:data
  })
}

export function updateProduct(id,data) {
  return request({
    url:'/product/update/'+id,
    method:'post',
    data:data
  })
}

export function getProduct(id) {
  return request({
    url:'/product/updateInfo/'+id,
    method:'get',
  })
}

export function updateVerifyStatus(params) {
  return request({
    url:'/product/update/verifyStatus',
    method:'post',
    params:params
  })
}

export function fetchVList(id) {
  return request({
    url:'/product/fetchVList/'+id,
    method:'get',
  })
}

export function checkProductRank(params) {
  return request({
    url:'/statistic/product/sale/rank',
    method:'post',
    data:params
  })
}
//单条删除旧的sku id
export function deleteSingleOldSku(id) {
  return request({
    url:'sku/delete/'+id,//{id}
    method:'delete',
  })
}
//批量删除旧的sku ids
export function deleteOldSkuids(params) {
  return request({
    url:'/sku/delete/batch',
    method:'post',
    data:params
  })
}
//批量保存更新后的sku info
export function updateEditSkuInfo(params) {
  return request({
    url:'/sku/batch/upsert',
    method:'post',
    data:params
  })
}

export function exportExcel() {
  return request({
    url:'/sku/export/template',
    method:'get',
  })
}

export function uploadExcel(params) {
  return request({
    url:'/sku/upload/template',
    method:'post',
    data:params
  })
}
